//
//  networkController.m
//  QUE_LESS
//
//  Created by Alex on 21/07/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "networkController.h"

@implementation networkController
@synthesize delegate;

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}
-(void)makeRequestForJSON:(NSString *)URL
{

    NSError *error;
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:URL]];
    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:&error];
    
    if(error)
    {
        NSLog(@"%@",[error localizedDescription]);
    }
  //  NSLog(@"raw response : %@",response);
    
    id jsonObject = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableLeaves error:nil];
       
    [self.delegate networkControllerResponse:jsonObject];
}
-(void)makeUpdateRequest:(NSString *)URL
{
    
    
}


@end
